package br.com.troca.carro.action;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Controller;

import br.com.troca.carro.facade.EnderecoFacade;
import br.com.troca.carro.vo.Endereco;

@Controller
@Scope("request")
public class EnderecoAction implements ComumAction {

	@Autowired
	private EnderecoFacade enderecoFacade;
	
	private Endereco endereco;
	
	public String incluir() {
		enderecoFacade.incluir(endereco);
		
		return SUCCESS;
	}

	public String alterar() {
		enderecoFacade.alterar(endereco);
		
		return SUCCESS;
	}

	public String excluir() {
		enderecoFacade.excluir(endereco);
		
		return SUCCESS;
	}

	public EnderecoFacade getEnderecoFacade() {
		return enderecoFacade;
	}

	public void setEnderecoFacade(EnderecoFacade enderecoFacade) {
		this.enderecoFacade = enderecoFacade;
	}

	public Endereco getEndereco() {
		return endereco;
	}

	public void setEndereco(Endereco endereco) {
		this.endereco = endereco;
	}

}
